package com.hdax.dm.rest.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hdax.dm.dao.order.DmOrderLinkUserMapper;
import com.hdax.dm.entity.order.DmOrderLinkUser;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(path = "/dmOrderLinkUser")
public class DmOrderLinkUserRestService extends ServiceImpl<DmOrderLinkUserMapper, DmOrderLinkUser> {

    //添加订单联系人
    @PostMapping(path = "/addOrderLinkUser")
    public int addOrderLinkUser(@RequestBody DmOrderLinkUser dmOrderLinkUser){
        System.out.println(dmOrderLinkUser);
        return baseMapper.insert(dmOrderLinkUser);
    }

    //删除订单联系人
    @PostMapping(path = "/deleteOrderLinkUser")
    public int deleteOrderLinkUser(@RequestParam("orderNo") String orderNo){
        QueryWrapper<DmOrderLinkUser> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("orderId",orderNo);
        return baseMapper.delete(queryWrapper);
    }

}
